home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / Time.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  1.7 KB  |  79 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3.     Time.h
  4.     Date and time
  5.     
  6.     Copyright © Apple Computer,Inc.  1987-1991.
  7.     All Rights Reserved.
  8.  
  9. ************************************************************/
  10.  
  11.  
  12. #ifndef __TIME_H__ /* __TIME__ is a reserved preprocessor symbol */
  13. #define __TIME_H__
  14.  
  15. #ifndef NULL
  16. #define NULL 0
  17. #endif
  18.  
  19. #ifndef __size_t__
  20. #define __size_t__
  21. typedef unsigned int size_t;
  22. #endif
  23.  
  24. /*
  25.  *    Declarations
  26.  */
  27.  
  28. #define CLOCKS_PER_SEC 60
  29. typedef unsigned long int clock_t;
  30. typedef unsigned long int time_t;
  31. struct tm {
  32.     int tm_sec;        /* Seconds after the minute -- [0, 61] */
  33.     int tm_min;        /* Minutes after the hour -- [0, 59] */
  34.     int tm_hour;    /* Hours after midnight -- [0, 23] */
  35.     int tm_mday;    /* Day of the month -- [1, 31] */
  36.     int tm_mon;        /* Months since January -- [0, 11] */
  37.     int tm_year;    /* Years since 1900 */
  38.     int tm_wday;    /* Days since Sunday -- [0, 6] */
  39.     int tm_yday;    /* Days since January 1 -- [0, 365] */
  40.     int tm_isdst;    /* Daylight Savings Time flag */
  41. };
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. /*
  48.  *    Time manipulation functions
  49.  */
  50.  
  51. clock_t clock(void);                        /* function */
  52. #define clock() __tickcount()                /* macro - TickCount() */
  53. pascal unsigned long __tickcount(void)
  54.     = 0xA975; 
  55.  
  56. double  difftime(time_t time1, time_t time0);                /* function */
  57. #define difftime(time1,time0) ((long double)time1 - time0)    /* macro */
  58.  
  59. time_t mktime(struct tm *timeptr);
  60. time_t time(time_t *timer);
  61.  
  62.  
  63. /*
  64.  *    Time conversion functions
  65.  */
  66.  
  67. char *asctime (const struct tm *timeptr);
  68. char *ctime(const time_t *timer);
  69. struct tm *gmtime(const time_t *timer);
  70. struct tm *localtime(const time_t *timer);
  71. size_t strftime(char *s, size_t maxsize,
  72.                  const char *format, const struct tm *timerptr);
  73.  
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77.  
  78. #endif
  79.